package com.ruoyi.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.entity.ForumPost;
import com.ruoyi.domain.entity.ForumPostDto;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 论坛Service接口
 * 
 * @author lsx
 * @date 2025-01-07
 */
public interface ForumPostService extends IService<ForumPost> {
    public ForumPostDto getInfoById(Integer id);

    boolean publishPost(ForumPost forumPost);

    // 使用 Map 缓存点赞请求，延迟批量处理
    Map<Integer, Integer> likeQueue = new HashMap<>();
    // 处理点赞请求
    void likePost(Integer postId);


    List<Integer> getLikeUserIds(Integer forumId);

    List<ForumPostDto> getTopLikedStockPosts(Integer stockId, Integer limit);
}
